package com.example.demo.controller;

import com.alibaba.fastjson.JSON;
import com.example.demo.dao.UserDao;
import com.example.demo.entity.vo.UserEntity;
import com.example.demo.service.TestI;
import com.example.demo.utils.SpringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.UUID;

@RestController
public class MemberController
{
    @Autowired
    UserDao userDao;

    @RequestMapping("/MemberIndex")
    public String memberIndex()
    {
        UserEntity user  = userDao.QueryById(122);
        return JSON.toJSONString(user);
        //return UUID.randomUUID().toString().replaceAll("-","");
    }

    @RequestMapping("/TestException")
    public String Index() throws Exception {
        throw new Exception("1");
        //return "life is fucking movie.";
    }

    @RequestMapping("/TestEmptyApi")
    public String TestEmptyApi()
    {
        return "Success1";
    }
}
